|
|
|
|
|
|
|
Figure 9.4.
The Employee information in the first normal form of design. |
|
|
|
|
|
|
|
|
When separating the data, you can see that some information is directly related to the employee and the other information is related to his or her skills. The Name column in the employee table would be the key, whereas the skill table would require both the name and the skill to define a unique row in the table. By using a name, you could get all the skills related to that employee. If you look closely at the skills table, notice that some information is related only to the skill, not the employee. This leads to the next step in the process. |
|
|
|
|
|
|
|
|
After you have a table with a primary key made up of more than one column, you need to take out of that table any data that depends on only part of the key. In this example, the skill description and the skill would be placed in a third table where the key would be only the skill. Before this step, if only one employee knew Visual Basic and that person left the company, the employee record along with all the skills related would be deleted from the database. When this happens, the skill and description for Visual Basic would vanish. After applying the second normal form to the database, a skill can exist even if no one has it. Further, your application could allow new skills to be added in advance of anyone having them. Figure 9.5 now shows the tables in second normal form. |
|
|
|
|
|